﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TT.Module.sysLogin;
using SQLHelper;
using SfcorpDLL.dao;
using SfcorpDLL.ety;
using System.Data;

namespace SfcorpDLL.biz
{
    public class bizSeachDtl
    {
        etyBaeSystemParamter basSysParam;
        daoSeachDtl doAgyBnsSearch;
        SQLHelp sqlImage = new SQLHelp();

        public bizSeachDtl(etyBaeSystemParamter ieyBasClassDeclare)
        {
            basSysParam = ieyBasClassDeclare;
            doAgyBnsSearch = new daoSeachDtl(basSysParam);
        }

        public IList<etyFrtAgyBns> GetAgyBnsResult(etyFrtAgyBns ey)
        {
            DataTable dt = doAgyBnsSearch.GetAgyBnsResult(ey);
            IList<etyFrtAgyBns> ilRusult = TT.Common.Converts.ConvertToIList<etyFrtAgyBns>(dt);
            return ilRusult;
        }

        public IList<etyFrtAgyBns> GetAgyBnsSum(etyFrtAgyBns ey)
        {
            DataTable dt = GetAgyBnsSumTable(ey);
            IList<etyFrtAgyBns> ilRusult = TT.Common.Converts.ConvertToIList<etyFrtAgyBns>(dt);
            return ilRusult;
        }

        public DataTable GetAgyBnsSumTable(etyFrtAgyBns ey)
        {
            DataTable dt = doAgyBnsSearch.GetAgyBnsSum(ey);
            DataTable dtCross = TT.Common.dataProcessor.DataTableCross(dt, "BNS_BILL_CROSS", "ITEM_DESC", "I_AMOUNT", 0, "O_AMOUNT", "O_AMOUNT");
            return dtCross;
        }
    }
}
